﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bussiness.Service;
using Ext.Net;

namespace Bussiness.View.BackEnd.User_Control
{
    public partial class Size : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string action = Request.Params.Get("Action");
            string id = Request.Params.Get("ID");
            
            if (X.IsAjaxRequest)
            {
                if (action != null && id != null)
                {
                    if (action == "SelectSize") loadSize(int.Parse(id));
                    pu_Size.Show();
                }
            }
        }

        public void loadSize(int idProduct)
        {
            DSSize_Store.DataSource = new Product_Service().getListSizeByProductID(idProduct);
            DSSize_Store.DataBind();
        }
    }
}